import { useState } from 'react'
import './App.css'

function App() {
  const [count, setCount] = useState(0)

  function handleClick() {

    // 异步
    // setCount(count + 1)
    // setCount(count + 1)

    // 同步
    setCount((count) => count + 1)
    setCount((count) => count + 1)
  }

  return (
    <>
      <div className="card">
        {/* <button onClick={() => setCount((count) => count + 1)}> */}
        <button onClick={handleClick}>
          count is {count}
        </button>
      </div>
    </>
  )
}

export default App
